package com.dominator.socket;

import com.dominator.enums.ReqEnums;
import com.dominator.enums.SocketEnums;
import com.dominator.utils.encode.Des3Utils;

import java.io.Serializable;

public class SocketMessage implements Serializable {
    String code;
    String message;
    String data;
    String router;
    String method;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getRouter() {
        return router;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public SocketMessage() {
    }


    public SocketMessage(ReqEnums reqEnums, String method,String router,Object object){
        this.code=reqEnums.getCode();
        this.message=reqEnums.getMsg();
        this.method=method;
        this.router=router;
        if (object !=null){
            this.data = Des3Utils.encResponse(object);
        }
    }

    public SocketMessage(ReqEnums reqEnums, String method,String router){
        this.code=reqEnums.getCode();
        this.message=reqEnums.getMsg();
        this.method=method;
        this.router=router;
    }

    public SocketMessage(SocketEnums reqEnums, String method, String router,Object object){
        this.code=reqEnums.getCode();
        this.message=reqEnums.getMsg();
        this.method=method;
        this.router=router;
        if (object !=null){
            this.data = Des3Utils.encResponse(object);
        }
    }

    public SocketMessage(SocketEnums reqEnums, String method, String router){
        this.code=reqEnums.getCode();
        this.message=reqEnums.getMsg();
        this.method=method;
        this.router=router;
    }
}
